function(nice_install_files install_dir)
    set(next_is_rel_loc OFF)
    set(relative_loc "")
    set(files "")

    foreach(entry ${ARGN})
        if(${entry} STREQUAL "ABSOLUTE")
            set(relative_loc "")
            continue()
        endif()
        if(${entry} STREQUAL "RELATIVE")
            set(next_is_rel_loc ON)
            continue()
        endif()
        if(${next_is_rel_loc})
            set(relative_loc "${entry}")
            set(next_is_rel_loc OFF)
            continue()
        endif()

        if("${relative_loc}" STREQUAL "")
            set(full_name "${entry}")
        else()
            set(full_name "${relative_loc}/${entry}")
        endif()
        list(APPEND files "${full_name}")
    endforeach()

    if(NOT "${files}" STREQUAL "")
        install(FILES ${files} DESTINATION ${install_dir})
    endif()
endfunction()
